import NProgress from 'nprogress'

import router from "./routes/index"

import 'nprogress/nprogress.css'

// 关闭右上角的加载圈圈
NProgress.configure({ showSpinner: false });


router.beforeEach((to, from, next) => {
	NProgress.start()

	// 路由拦截 - 用于登录授权
	// if (to.path !== '/login') {
	// 	if (getStorage(ACCESS_TOKEN)) {
	// 		return next()
	// 	} else {
	// 		return next('/login')
	// 	}
	// } else {
	// 	if (getStorage(ACCESS_TOKEN)) {
	// 		return next('/')
	// 	}
	// }
	next()
})

router.afterEach(()=> {
	NProgress.done()
})
